<?php

//use Illuminate\Support\Facades\Schema;
use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('messages', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedBigInteger('product_id')->default(0)->comment('产品ID')->index();
            $table->string('name')->default('')->comment('留言人称呼');
            $table->string('email')->default('')->comment('留言人邮箱');
            $table->string('phone')->default('')->comment('留言人电话');
            $table->text('info')->default('')->comment('留言信息');
            $table->timestamps();
            $table->comment = '留言表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('messages');
    }
}
